package org.example.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;

@Component(value = "admin")
@Data //getters and setters
@NoArgsConstructor //无参构造方法
@AllArgsConstructor //全参构造方法
public class Admin {
     private Integer id;
     private String account;
     private String password;
     private String adminToken;
     private String gender;
     private String phone;
     private Integer type;
     private Admin admin;//封装操作人
     private Date operTime;
     //分页查询参数
     private Integer pageNumber;//当前页码
     private Integer pageSize;//每页显示的记录数
     //     接菜单数组
     private Integer[] menuIds;

     @DateTimeFormat(pattern = "yyyy-MM-dd")//给前端提交到后端的数据日期指定转换格式
     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")//后端把对象转为json时,指定日期的格式
     private Date birthday;

     private List<Menu> menus;//封装菜单列表


}
